import types from './mutation-types'
export default {
	// 获取订单列表
	[types.FETCH_PAYMENTS](state, payload) {
		state.pay = payload.pay
		state.params = payload.params
	},
	[types.UPDATE_FINANCE_TAB](state, payload) {
		state.financeTab = payload.financeTab
		state.financeVisi = payload.financeVisi
		// state.params = payload.params
	},
	[types.FETCH_FINANCE](state, payload) {
		state.financePage = payload.financePage
		state.payments = payload.payments
	},
	[types.GET_INVOICE](state, payload) {
		state.payments = payload.payments
		state.financePage = payload.financePage
	},
	[types.UPDATE_FINANCE](state, payload) {
		let datas = []
		let idxs = state.finance_role[payload.user_type];
		if(!!idxs && idxs.length > 0) {
			idxs.forEach((v) => {
				datas.push(state.finance_list[v])
			});
		}
		state.finance_tabs = datas
		// state.params = payload.params
	}

	//	[types.UPDATE_FINANCE](state, payload) {
	//		let datas = []
	//		let idxs = state.finance_role[payload.user_type];
	//		if(!!idxs && idxs.length > 0) {
	//			idxs.forEach((v) => {
	//				datas.push(state.finance_list[v])
	//			});
	//		}
	//		state.finance_tabs = datas
	//		// state.params = payload.params
	//	},

}